char *ppdb_fmt_float(const double val)
{
+ char *c;
char *str = str_pool_get(32);
snprintf(str, 32, "%.8f", val);
- char *c = str + strlen(str) - 1;
+ c = str + strlen(str) - 1;
while ((c > str) && (*c == '0'))
{
*c = '\0';
char *ppdb_fmt_degrees(char dir, double val)
{
+ char *tmp;
char *str = str_pool_get(32);
int deg = abs(val);
double min = 60.0 * (fabs(val) - deg);
snprintf(str, 31, "%c%02d 000", dir, deg);
snprintf(str + 6 - power, 24, "%.8f", min);
- char *tmp = str + strlen(str) - 1; /* trim trailing nulls */
+ tmp = str + strlen(str) - 1; /* trim trailing nulls */
while ((tmp > str) && (*tmp == '0'))
{
*tmp = '\0';
int ppdb_decode_tm(char *str, struct tm *tm)
{
int i = 3;
- int msec, d1, d2, d3, d4;
+ int msec, d1, d2, d3, d4, year;
time_t tnow;
struct tm now;
now.tm_year += 1900;
now.tm_mon++;
- int year = (d1 * 100) + d2;
+ year = (d1 * 100) + d2;
/* next code works for most, except for 19. and 20. of month */
/* for trouble use input date format - !!! ToDo !!! */
for (pdb_rec = pdb_in->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next)
{
+ int line = 0;
waypoint *wpt_tmp = waypt_new();
data = (char *) pdb_rec->data;
- int line = 0;
str = csv_lineparse(data, ",", """", line++);
while (str != NULL)
{
--- /dev/null
+<?xml version="1.0"?><loc version="1.0" src="EasyGPS">
+<waypoint>
+<name id="GCEBB"><![CDATA[Mountain Bike Heaven by susy1313]]></name>
+<coord lat="35.972033" lon="-87.134700"/>
+</waypoint>
+<waypoint>
+<name id="GC1A37"><![CDATA[The Troll by a182pilot & Family]]></name>
+<coord lat="36.090683" lon="-86.679550"/>
+</waypoint>
+<waypoint>
+<name id="GC1C2B"><![CDATA[Dive Bomber by JoGPS & family]]></name>
+<coord lat="35.996267" lon="-86.620117"/>
+</waypoint>
+<waypoint>
+<name id="GC25A9"><![CDATA[FOSTER by JoGPS & Family]]></name>
+<coord lat="36.038483" lon="-86.648617"/>
+</waypoint>
+<waypoint>
+<name id="GC2723"><![CDATA[Logan Lighthouse by JoGps & Family]]></name>
+<coord lat="36.112183" lon="-86.741767"/>
+</waypoint>
+<waypoint>
+<name id="GC2B71"><![CDATA[Ganier Cache by Susy1313]]></name>
+<coord lat="36.064083" lon="-86.790517"/>
+</waypoint>
+<waypoint>
+<name id="GC309F"><![CDATA[Shy's Hill by FireFighterEng33]]></name>
+<coord lat="36.087767" lon="-86.809733"/>
+</waypoint>
+<waypoint>
+<name id="GC317A"><![CDATA[GittyUp by JoGPS / Warner Parks]]></name>
+<coord lat="36.057500" lon="-86.892000"/>
+</waypoint>
+<waypoint>
+<name id="GC317D"><![CDATA[Inlighting by JoGPS / Warner Parks]]></name>
+<coord lat="36.082800" lon="-86.867283"/>
+</waypoint>
+</loc>
static waypoint *wpt_tmp = NULL;
static int item_count = -1;
static int waypoints = 0;
-static int mapsource = 0;
static route_head *route = NULL;
waypoint_final();
if (waypoints != item_count)
{
- fatal(MYNAME ": count waypoints differ to interlal ItemCount!\n");
+ fatal(MYNAME ": waypoint count differs to internal \"ItemCount\"! (%d to %d)\n", waypoints, item_count);
}
}
wpt_tmp = waypt_new();
wpt_tmp->centiseconds = 0;
- waypoints++;
-
if ((waypoints == 1) || (waypoints == item_count))
wpt_tmp->centiseconds++;
#
# TourExchangeFormat tef (read only)
#
-rm -f ${TMPDIR}/tef_xms.mps
-${PNAME} -r -i tef -f reference/route/tef_xml.sample.xml -o mapsource -F ${TMPDIR}/tef_xml.mps
-bincompare ${TMPDIR}/tef_xml.mps reference/route/tef_xml.mps
+rm -f ${TMPDIR}/tef_xml*
+${PNAME} -r -i tef -f reference/route/tef_xml.sample.xml -o gpx -F ${TMPDIR}/tef_xml.sample.gpx
+grep -v "<time>" reference/route/tef_xml.sample.gpx > ${TMPDIR}/tef_xml.sample.gpx.ref
+grep -v "<time>" ${TMPDIR}/tef_xml.sample.gpx > ${TMPDIR}/tef_xml.sample.gpx.new
+compare ${TMPDIR}/tef_xml.sample.gpx.ref ${TMPDIR}/tef_xml.sample.gpx.new
#
# PathAway Palm Database .pdb tests